import { NgModule, SkipSelf, Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '../core/core.module';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { AutoCompleteModule } from 'primeng/autocomplete';
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { TreeModule } from 'primeng/primeng';
import { SidebarModule } from '../sidebar/sidebar.module';

import { TreeTableModule } from '../public/treetable/treetable';
import { PublicModule } from '../public/public.module';
import { SystemModule } from '../system/system.module';
import {MatButtonModule,MatInputModule,MatCheckboxModule} from '@angular/material';

import { ProductComponent } from './product.component';
import { ProductIndexingTaskComponent } from './product-indexing-task/product-indexing-task.component';
import { ProductIndexingTaskListComponent } from './product-indexing-task/list/product-indexing-task-list.component';
import { ProductIndexingTaskListTableComponent } from './product-indexing-task/list/table/product-indexing-task-list-table.component';
import { ProductIndexingTaskListAddComponent } from './product-indexing-task/list/add/product-indexing-task-list-add.component';
import { ProductIndexingTaskListAssignToComponent } from './product-indexing-task/list/add/product-indexing-task-list-assign-to.component';
import { ProductIndexingTaskListAuditPersonsComponent } from './product-indexing-task/list/add/product-indexing-task-list-audit-persons.component';
import { ProductIndexingTaskListThemeComponent } from './product-indexing-task/list/add/product-indexing-task-list-theme.component';
import { ProductIndexingTaskListProductComponent } from './product-indexing-task/list/add/product-indexing-task-list-product.component';
import { ProductIndexingChildListProductComponent } from './product-indexing-task/list/add/product/app-product-indexing-child-list-product.component';
import { ProductIndexingTaskListDelComponent } from './product-indexing-task/list/delete/product-indexing-task-list-del.component';
import { ProductIndexingTaskCompleteComponent } from './product-indexing-task/list/completestatus/product-indexing-task-complete.component';
import { ProductIndexingTaskSubmitComponent } from './product-indexing-task/list/submitstatus/product-indexing-task-submit.component';

import { ProductIndexingTaskAuditComponent } from './product-indexing-task/audit/product-indexing-task-audit.component';
import { ProductIndexingTaskAuditTableComponent } from './product-indexing-task/audit/table/product-indexing-task-audit-table.component';
import { ProductIndexingTaskCheckComponent } from './product-indexing-task/audit/checkstatus/product-indexing-task-check.component';

import { ProductIndexingTaskContentComponent } from './product-indexing-task/content/product-indexing-task-content.component';
import { ProductIndexingTaskContentTableComponent } from './product-indexing-task/content/table/product-indexing-task-content-table.component';
import { ProductIndexingTaskContentDelComponent } from './product-indexing-task/content/delete/product-indexing-task-content-del.component';
import { ProductIndexingTaskContentAuditComponent } from './product-indexing-task/content/audit/product-indexing-task-content-audit.component';
import { ProductIndexingTaskContentRefIndexComponent } from './product-indexing-task/content/refIndex/product-indexing-task-content-refIndex.component';

import { AppProductIndexTaskContentAddComponent } from './product-indexing-task/content/add/app-product-index-task-content-add.component';
import { ProductExportComponent } from './product-indexing-task/content/product-export/product-export.component';
import { ThemeTableComponent } from './product-indexing-task/list/add/theme-table/theme-table.component';
import {ProductIndexingTaskListProjectComponent} from './product-indexing-task/list/add/project/product-indexing-task-list-project.component';
import { TemplateComponent } from './product-indexing-task/list/add/template/template.component';

@NgModule({
	imports: [
    	BsDatepickerModule.forRoot(),
		CommonModule,
		CoreModule,
		RouterModule,
		FormsModule,
		TreeModule,
		TreeTableModule,
		PublicModule,
		SystemModule,
		AutoCompleteModule,
		MatButtonModule,
		MatCheckboxModule,
		SidebarModule
	],
	declarations: [
		ProductComponent,
		ProductIndexingTaskComponent,
		ProductIndexingTaskListComponent,
		ProductIndexingTaskListTableComponent,
		ProductIndexingTaskListAddComponent,
		ProductIndexingTaskListAssignToComponent,
		ProductIndexingTaskListAuditPersonsComponent,
		ProductIndexingTaskListThemeComponent,
		ProductIndexingTaskListProductComponent,
		ProductIndexingChildListProductComponent,
		ProductIndexingTaskListDelComponent,
		ProductIndexingTaskCompleteComponent,
		ProductIndexingTaskSubmitComponent,

		ProductIndexingTaskAuditComponent,
		ProductIndexingTaskAuditTableComponent,
		ProductIndexingTaskCheckComponent,

		ProductIndexingTaskContentComponent,
		ProductIndexingTaskContentTableComponent,
		ProductIndexingTaskContentDelComponent,
		ProductIndexingTaskContentAuditComponent,
		ProductIndexingTaskContentRefIndexComponent,
        ProductIndexingTaskListProjectComponent,
		AppProductIndexTaskContentAddComponent,
		ProductExportComponent,
		ThemeTableComponent,
		TemplateComponent
	]
})
export class ProductModule {
	constructor( @Optional() @SkipSelf() parent: ProductModule) {
		if (parent) {
			throw new Error('Product模块已经加载，不要再次加载')
		}
	}
}
